If the U.S. Senate Was a Hedge Fund, How Would It Do?

Answer: Not very well...


By: Shane Copsey, MeiJade Hsu, and Athen Pham
CMSC320 - Introduction to Data Science, University of Maryland, Fall 2021, John Dickerson



For this analysis, our team answers the question:

How well do U.S. senators trade? Do they consistently outperform the S&P 500 index?

Using publicly-available data from 2012-2021, we will construct a few portfolios that simulate U.S. senators' stock trades (buying and selling of stocks) over this 9.5-year period and measure their performance against the S&P 500 index.

The S&P 500 index is the best-known indicator of the U.S. stock market's performance, measuring the value—and thus the performance—of the 500 largest (by market value) publicly-traded U.S. companies. This indicator is so important in trading and investing that many simply refer to it as "the market." The 500 constantly-changing companies in the S&P 500 are very well-known companies that we frequently encounter in our day-to-day lives:

SP-500-logos.jpeg

Many investors measure professional money managers' performance against the S&P 500. The thinking goes that an investor has two mutually-exclusive choices:

  1. Invest their money with a professional money manager, or
  2. Buy an exchange-traded fund (ETF) that tracks the performance of the S&P 500 (the market).

If the professional money manager doesn't outperform the S&P 500, then the investor may as well buy the S&P 500 ETF since they'd make more money that way, often at a lower cost and risk (usually with other diverse ETFs). Professional money managers charge fees and can make riskier investments like private equity. Therefore, to make it worthwhile for investors to accept a higher cost and risk by investing their money with them, professional money managers should perform better on a percentage basis than the market (usually expressed through the S&P 500).

Here's a chart of the S&P 500's value at the end of each trading day from 1950-2016. One way to easily interpret this chart: If you'd spent a handful of dollars to buy a single share of an S&P 500 ETF in 1950, you could sell that single share for over $2,000 in 2016:

sp.png

Studies have consistently shown that most professional money managers underperform the S&P 500—over a 15-year period, only 5% of professional money managers managed to beat it. Therefore, if we find that senators have outperformed the S&P 500 over the past 9.5 years, then our finding would be significant since it would show that senators—many of whom are lawyers and businessmen, not money managers—are better at investing than 95% of professional money managers. This would be a rare and impressive achievement indeed.

The question would then be: How can senators be above-average at investing?

Insider trading and the STOCK Act

Although insider trading—trading a company's stock based on nonpublic ("insider") information about the company—has been illegal and punishable by fines and/or imprisonment for most private citizens in the U.S. since 1934, it was not made illegal for members of Congress until 2012. Congress passed the Stop Trading on Congressional Knowledge (STOCK) Act which was then signed into law by President Obama on April 4, 2012, to ban insider trading among members of Congress.

Specifically, the STOCK Act prohibits members of Congress and other government officials from using, for personal benefit, insider information that they acquired through their government positions. This means that if a member of Congress acquires information that shows a positive future for a company, then they cannot buy that company's stock until the information they acquired becomes public. Also, if a member of Congress acquires information that shows a negative future for a company, then they cannot sell that company's stock until the information they acquired becomes public. The Act also requires all members of Congress to publicly disclose any financial transactions (which is mostly buying and selling) of stocks, bonds, commodities, futures, options, cryptocurrencies, and other securities within 30-45 days of the transaction.

In the nearly ten years since the STOCK Act became law, however, stock trading by members of Congress has repeatedly caused controversy and has raised ethical concerns. In 2020, a major insider trading scandal occurred when six senators sold stocks after attending a confidential briefing on the coronavirus outbreak in January 2020, potentially avoiding losses when the stock market crashed in March 2020. In 2021, Business Insider identified 127 current members of Congress who had either personally or whose staffers had violated provisions of the STOCK Act:

Business Insider STOCK Act Investigation.png

Before the STOCK Act made insider trading by members of Congress illegal, members of Congress had performed exceptionally well compared to the S&P 500. A 2004 study in the Journal of Financial and Quantitative Analysis found that senators outperformed the S&P 500 by an astonishing average of 12 percentage points per year (or 1 percentage point per month) during a 6-year period in the bull market of the 1990s. This means that if the S&P 500's value increased by 10% over a year, then the value of a portfolio consisting of all trades made by senators during that year would increase by 22%.

Senators didn't just beat an already high-performing market: They also beat corporate insiders (people who were trading their own company's stock)—who outperformed the market by an average of 6 percentage points per year—and U.S. households—who underperformed the market by an average of 1.4 percentage points per year. Senators also appeared to know exactly when to buy and sell stocks: They would buy stocks just before the stocks would suddenly outperform the market by more than 25%, and they would sell stocks that had been beating the market by about 25% for the past year just before those stocks would fall back in line with the market's performance. The study's researchers suggested that senators knew when to buy and sell stocks because they had access to information based on their government positions that other investors didn't have—in other words, they were insider trading.

Therefore, another question that our analysis will help answer is:

Is the STOCK Act preventing U.S. senators from benefiting from insider trading?

If we find that senators continued to outperform the S&P 500 from 2012-2021 (i.e., after the STOCK Act was signed into law), then we may have evidence that the STOCK Act didn't achieve its goal of preventing senators from benefiting from insider trading. On the flip side, if we find that senators didn't outperform the S&P 500 from 2012-2021, then we may have evidence that the STOCK Act did prevent senators from benefiting from insider trading.

To answer this question, we'll treat the U.S. Senate as one cohesive unit. We'll download data on all of the stock trades that they've disclosed since the STOCK Act was signed in 2012 and use Python to construct portfolios that simulate their trades (buys and sells) over this 9.5-year period. This means that we'll buy about (exact transaction data was not revealed, but ranges of amounts bought and sold were) the same amount of the same stock that they bought on the same day in the past and sell about the same amount of the same stock that they sold on the same day in the past. Then, we'll convert the portfolio into an index that we'll compare with the S&P 500 index to see whether senators performed better than the S&P 500 on a percentage basis in the 9.5 years since the STOCK Act was signed into law.

Importing and cleaning the data

We downloaded four datasets. For each dataset, we downloaded data from July 25, 2021 (when the first trade was disclosed under the newly-enacted STOCK Act) to December 8, 2021 (when we were writing the code for this project):

  1. A CSV of all transactions made by senators from SenateStockWatcher.com, a free website maintained by members of the public who compile transactions disclosed by senators into CSV and JSON files. On the API page, under the "Bulk Downloads" section, click on the "Download" link in the "All Transactions" row whose file type is a CSV.
  2. A CSV of the daily closing prices and other data of all stocks traded by senators from Compustat, a research-grade database well-known among academics and professionals in the financial world. We received access to Compustat through an educational license. Members of the public can query APIs maintained by third-party websites including TradingView and Polygon, although they may have to pay for a subscription.
  3. A CSV of the daily closing values of the S&P 500 index from the Nasdaq website maintained by Nasdaq, which owns and operates the Nasdaq Stock Market. The Nasdaq Stock Market is the 2nd-largest stock market in the world (behind the New York Stock Exchange) and where many well-known tech companies like Google, Apple, Facebook, Amazon, and Microsoft trade.
  4. A CSV of the daily closing values of the Nasdaq Composite from the Nasdaq website. The Nasdaq Composite measures the value, and thus the performance, of almost all stocks that trade on the Nasdaq stock exchange. We compare the Senate's performance against the Nasdaq since other 3rd-party analyses suggest that members of Congress buy and sell companies in the information technology sector the most frequently.

Importing libraries

Dataset #1: All transactions made by U.S. senators from SenateStockWatcher.com

If you go through all 8,928 rows of the Senate data, you'll see that the data are inconsistently formatted. This may be due to the Senate changing the format over time to report market activity. Specifically:

  1. For some stock trades, the stock's ticker (an abbreviation that the stock trades under on the stock exchange) is located in the asset_description column instead of the ticker column, where it should belong. Therefore, one would have to use a regular expression to find tickers that were improperly listed in the asset_description column, then copy them into the ticker column.
  2. The asset_type column, which specifies the type of security or derivative that was traded (i.e., stock, bond, option, etc.), is blank for transaction dates 2012/07/25 to 2014/12/18, after which senators began filling it out. Therefore, for transaction dates 2012/07/25 to 2014/12/18, one would have to look at the ticker and asset_description columns to determine whether a particular transaction was a stock trade.
  3. From 2012/07/25 to 2014/01/22, senators disclosed all transactions in PDF format. The volunteers who maintain SenateStockWatcher.com did not transcribe these disclosures into CSV format, so we'll, unfortunately, have to exclude all these transactions from our analysis. This means that there will be fewer data points from 2012 to 2014 (we still have some, just not a lot) compared with 2015 through 2021.

Therefore, given the inconsistent formatting of the Senate dataset, we'll have to clean it before we can analyze it.

Compustat takes a `.txt` file containing the tickers we want data for with one ticker on each line. Therefore, we'll write all of the unique tickers that senators traded to a `.txt` file and reformat some of them to match Compustat's symbol convention to avoid errors.

Dataset #2: Daily closing prices and other data from Compustat

Downloading data from Compustat is a manual process that takes place outside of this tutorial. Thus, after we download our data from Compustat as a CSV, we'll load it into our notebook.

Compustat has 74 unique variables that you can download for each ticker. We downloaded 21 of them, although we didn't end up using all of them in our analysis. The CSV that we downloaded has 2,591,494 rows and 363 MB of data, so it is a large dataset.

Compustat provides the open, high, low, and close prices, the trading volume, and the adjustment factor for each trading day in our analysis period (2012/07/25 to 2021/12/08) for each ticker that senators traded. Also, under the `gsector` column, Compustat lists the Global Industry Classification Standard (GICS®) sector of the stock associated with that row. There are 11 GICS® sectors, which represent the major economic sectors that businesses operate within: Consumer Discretionary, Consumer Staples, Energy, Materials, Industrials, Healthcare, Financials, Information Technology, Real Estate, Communication Services, and Utilities. Here's a chart showing the sector breakdowns for the companies in the S&P 500:

sp_sectors.png

The adjustment factor is a value that we divide each stock's price by to avoid misrepresentation of any stock's relative worth. Why?

Companies can perform a stock split—when they split a single share of stock into more shares of stock—if they want to decrease the price of their stock. For example, if you own one share of Tesla stock and Tesla performs a 2-for-1 stock split when its stock price is \$100, then you now own two shares of Tesla (since you get two shares for each share of Tesla that you own) and Tesla's stock price is now \$50 (since each share was split in half, so its price must also be half the original price). However, the total value of your Tesla stock is still \$100 (two shares multiplied by a \$50 price per share). Think of stock splits like cutting a cake—after cutting the cake in half, the cake is still the same size, just split in half. There are also reverse stock splits which are far less common than regular stock splits—at least with stocks in the S&P 500 and other large stocks.

We have to adjust stock prices for stock splits so that we accurately calculate gains (profits) and losses on trades over time since senators will buy and sell the same stock at vastly different prices if that stock splits. Adjusting stock prices for stock splits leads to an apples-to-apples comparison between stock prices for the same company at different points in time.

Since Compustat won't have every ticker that we want, let's find the tickers that we reformatted that it has as well as the tickers that we reformatted that it doesn't have. We'll have to exclude the tickers that Compustat doesn't have from our analysis, although they shouldn't have a noticeable impact since there are only a few of them.

Among the tickers that we didn't reformat, Compustat may not have some of those, either. We'll have to exclude these tickers from our analysis, too. Let's identify them just in case they give us errors when we construct our portfolios/indices. We conjecture that Compustat may not have some of these tickers since they're no longer publicly traded for reasons including "going private" (e.g., YHOO (Yahoo), which is now a privately-owned company), going bankrupt, being acquired by another company, etc. A major difficulty that anyone will run into when they try to analyze past stock market data is dealing with companies whose stocks no longer trade publicly. There may also be mutual funds and foreign stocks (outside the U.S.) unavailable in Compustat's dataset.

Constructing Senate portfolios/indices

As more data was being extracted from the data set and as the calculator above was being improved, sometimes index calculations would shift quite a bit. Improvements in precision and accuracy would sometimes lead to significant differences in outcome, but this index calculator has become much more precise and accurate. It seems that the calculation/function becomes less accurate as time goes on as we have not taken everything into account in the stock market, such as when companies are acquired, merged, or go private.

Visualizing and drawing conclusions from the data

Now, for the moment of truth: Did the Senate outperform the S&P 500 from 2012-2021?

Senate Index vs. S&P 500 (and Nasdaq Composite) Line Graph:

To compare senators' investing ability against the market, we compared our calculated Senate indices with stock market indices, specifically the S&P 500 and Nasdaq Composite. Our Senate index function uses an initial reference index value of $100 and measures the change over time. We used the same overlapping time frame for the stock market indices and our Senate indices, 2012/09/13 to 2021/11/29. To fit our stock market indices to the initial 100 reference index, we took the stock market index on 2012/09/13, and for each consecutive day, we divided each day's value by the initial 2012/09/13 value and multiplied by 100. As a result, we have the Senate index plotted with the stock market indices fitted to have an initial value of 100 to measure their performances proportionally over time.

Using this graph, we can determine the performance of our Senate indices compared with multiple stock market indices and potentially help determine if the STOCK Act was effective in preventing senators from profiting off of insider trading.

In the chart above, the blue line is the index representing the Senate's approximated performance, the light-blue lines being the same index for best- and worst-case trade execution rather than using the closing prices (e.g., best-case would be buying on the low of the day and selling on the high of the day, but the lower bound of the amount of stock traded each transaction is still used), the red line is the S&P 500 index, and the green line is the Nasdaq Composite index. The intuitive way to interpret the chart is: If you'd invested \$100 into a portfolio managed by the Senate in 2012, your investment would be worth a little over \$200 now in 2021, doubling the value of your investment over 9.5 years. Not bad, right?

Wrong, because if you'd invested the same \$100 into a low-cost exchange-traded fund (ETF) tracking the S&P 500 at the same time in 2012, your investment would be worth over \$300 now in 2021. Logically, you would've chosen to invest in the S&P 500 ETF instead of with the Senate since you would've made more money with less risk by just following the market.

Additionally, if you'd invested the same \$100 into a low-cost ETF tracking the Nasdaq Composite at the same time in 2012, your investment would be worth even more now in 2021—about \$500.

Thus, the answer to our question, "How well do U.S. senators trade? Do they consistently outperform the S&P 500 index?", is that senators, when taken as a whole, have traded poorly and underperformed the market in almost calendar every year likely because the STOCK Act shed light on them and made clear that they may not engage in insider trading. After making it illegal for themselves to engage in insider trading, senators are no longer able to achieve the above-average gains that they achieved when they were allowed to engage in insider trading before the STOCK Act.

Below, we quantify our results and examine the annual percentage returns for the Senate and S&P 500 from 2013-2020.

Senate Index: Equal-Weight Edition

What if the Senate was a hedge fund, and each senator had an equal say in what the hedge fund invested in? That is, if the hedge fund had \$100 million to invest, then each senator would decide how to invest \$1 million of it if all 100 senators participated (non-participants are simply excluded). Let's calculate an index that's equally weighed between the senators who were trading at any given time.

The chart above is similar to the previous chart, but instead of calculating the holdings of all senators as one group, it weighs all senators with stock positions equally, i.e., if there are five senators with stocks, then each senator will be 20% of the index at that moment. The idea behind this index is that just because a senator has more money does not necessarily mean that they manage it better. For instance, some much older senators have had much more time to accumulate money. The equally-weighed index gives each senator an equal voice in the portfolio and allows us to see whether with the bias of wealth removed, how good senators are at picking stocks to buy and sell.

As you can see, when each senator gets an equal voice in determining which stocks to buy and sell, the Senate performs better as a whole. Although the Senate would still underperform the S&P 500 and Nasdaq Composite from 2020-2021, it would outperform the S&P 500 at least from 2014-2019.

Grouped Bar Chart

To analyze and compare the performance of the Senate's returns, we plotted a grouped bar chart of annual returns from the original Senate index and the S&P 500. Alongside the percent annual returns from 2013-2020 for the Senate and S&P 500, the green bar represents the performance of the Senate annual returns relative to the S&P 500.

As indicated by the grouped bar chart, the Senate's annual returns tended to underperform compared to the S&P 500, except in 2016 and 2017. For the rest of these years, the Senate had a negative return compared to if they had instead invested in the S&P 500.

Pie Charts

To explore what senators commonly invested in, we constructed multiple pie charts to analyze the purchased stocks per sector per calendar year. Using our Senate data from SenateStockWatcher.com and ticker data from Compustat with GICS® sector values, we graphed each sector's purchase percentage for that year.

From our pie charts, you can see that Utilities and Real Estate weren't commonly purchased sectors while Energy, Materials, Industrials, Financials, Information Technology, and Health Care were consistently purchased more frequently. Interestingly, 2014, 2016, 2017, and 2018 showcased the most equally distributed purchases by sector.

Line Graph

Another way we visualize the sector distribution is using a multi-line graph that also tracks each GICS® sector's purchase percentage over each calendar year.

From our line graph, we see that Materials, Financials, Information Technology, and other sectors outside the GICS® sectors increased in percent of annual purchases from 2019 to 2021. While it appears that senators mostly purchased stocks within the Materials and Financials sectors in 2012-2013, the data from that period is very limited and therefore shouldn't be strongly considered when analyzing the sector purchase distributions over time.


Validating Our Results

Our results align with those in an April 2020 paper published under the National Bureau of Economic Research by a team from Dartmouth College. The team studied senators' stock-trading performance between 2012—when the STOCK Act was passed—and March 2020, after the congressional insider trading scandal came to light. Highlights of their study include that senators' stock purchases underperformed at the six-month outset by -0.17% in the same industry and stock size while also underperforming at shorter intervals, but their stock purchases slightly outperformed by +0.14% at the one-year mark.

You can find the MarketWatch article on the study here.

And the link to the PDF of the study here.


Conclusion

How well do U.S. senators trade? Do they consistently outperform the S&P 500 index?

Based on our line graphs with our calculated Senate indices and Adjusted S&P 500 and NASDAQ market indices, we can see that senators are consistently underperforming compared to the market indices from 2012-2021. Therefore if someone were to compare investing \$100 into what senators invested in since 2012, it would only be worth a little above \$200. Instead, if someone were to purchase a single ETF tracking the S&P 500 or NASDAQ, also at \$100, it would be currently worth over \$300 or about \$500, respectively.

Is the STOCK Act preventing U.S. senators from benefiting from insider trading?

While our analysis can't give a definitive answer on whether the STOCK Act prevented senators from benefiting from insider trading, our analysis does provide evidence that it did. When comparing our Senate index with the S&P 500 and NASDAQ, senators consistently underperformed the market indices. Given that senators were no longer able to beat the market as they had before the STOCK Act in the 1990s and the 2000s, this suggests that the STOCK Act may have been effective in preventing senators from benefiting from insider trading since the Senate underperformed after the STOCK Act.

Getting stock data without Compustat

Finally, while we used Compustat to access stock data, not everyone has access to it, so polygon.io and/or scraping data from TradingView can be used instead.